<?php
use_helper('I18N');
?>
<div class="breadcrumbs" id="breadcrumbs">
<script>
$(function() {
    $("#registerForm").validate({
        rules : {
            "fullname" : {
                required : true,
                minlength : 2
            },
            "ic" : {
                required : true,
                minlength : 3
            },
            "address" : {
                required : true,
                minlength : 3
            },
            "postcode" : {
                required : true,
                minlength : 3
            },
            "email" : {
                required : true
                , email: true
            },
            "contactNumber" : {
                required : true
                , minlength : 10
            }
        },
        submitHandler: function(form) {
            waiting();
            form.submit();
        },
        success: function(label) {
            //label.addClass("valid").text("Valid captcha!")
        }
    });

    $("#btnSubmit").click(function(){
        $("#registerForm").submit();
    });

    $("#bankForm").validate({
        messages : {
            transactionPassword: {
                remote: "Security Password is not valid."
            }
        },
        rules : {
            "bankName" : {
                required : true,
                minlength : 3
            },
            "bankAccNo" : {
                required : true,
                minlength : 3
            },
            "bankHolderName" : {
                required : true,
                minlength : 3
            }
        },
        submitHandler: function(form) {
            waiting();
            form.submit();
        },
        success: function(label) {
            //label.addClass("valid").text("Valid captcha!")
        }
    });

    $("#btnBankUpdate").click(function(){
        $("#bankForm").submit();
    });
});
</script>

    <ul class="breadcrumb">
        <li>
            <i class="icon-home home-icon"></i>
            <a href="/member/summary">Home</a>
        </li>

        <li class="active"><?php echo __('Personal Information') ?></li>
    </ul>

    <div class="nav-search" id="nav-search">
        <form class="form-search">
            <span class="input-icon">
                <input type="text" placeholder="Search ..." class="nav-search-input"
                       id="nav-search-input" autocomplete="off"/>
                <i class="icon-search nav-search-icon"></i>
            </span>
        </form>
    </div>
    <!-- #nav-search -->
</div>

<div class="page-content">
    <div class="page-header">
        <h1>
            <?php echo __("Personal Information")?>
        </h1>
    </div>

    <div class="row">
        <div class="col-xs-12">
            <!-- PAGE CONTENT BEGINS -->
            <?php include_component('component', 'alert', array('param' => $sf_user->getAttribute(Globals::SESSION_DISTID, 0))) ?>

            <form action="/member/updateProfile" id="registerForm" name="registerForm" method="post" class="form-horizontal" role="form">
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"><?php echo __("Full Name")?></label>

                    <div class="col-sm-9">
                        <input name="fullname" type="text" id="fullname" tabindexBak="5"
                                             size="30" value="<?php echo $distDB->getFullName() ?>"/>
                    </div>
                </div>

                <div class="space-4"></div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"><?php echo __("NRIC")?></label>

                    <div class="col-sm-9">
                        <input name="nric" type="text" id="nric" tabindexBak="5"
                                             size="30" value="<?php echo $distDB->getIc() ?>"/>
                    </div>
                </div>

                <div class="space-4"></div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"><?php echo __("Country")?></label>

                    <div class="col-sm-9">
                        <?php include_component('component', 'countrySelectOption', array('countrySelected' => $distDB->getCountry(), 'countryName' => 'country', 'countryId' => 'country')) ?>
                    </div>
                </div>

                <div class="space-4"></div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"><?php echo __("Address")?></label>

                    <div class="col-sm-9">
                        <input name="address" type="text" id="address" tabindexBak="13" size="30"
                                             value="<?php echo $distDB->getAddress() ?>"/>
                    </div>
                </div>

                <div class="space-4"></div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"><?php echo __("Address")?></label>

                    <div class="col-sm-9">
                        <input name="address2" type="text" id="address2" tabindexBak="13" size="30"
                                             value="<?php echo $distDB->getAddress2() ?>"/>
                    </div>
                </div>

                <div class="space-4"></div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"><?php echo __("City / Town")?></label>

                    <div class="col-sm-9">
                        <input name="city" type="text" id="city" tabindexBak="13" size="30"
                                             value="<?php echo $distDB->getCity() ?>"/>
                    </div>
                </div>

                <div class="space-4"></div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"><?php echo __("State / Province")?></label>

                    <div class="col-sm-9">
                        <input name="state" type="text" id="state" tabindexBak="13" size="30"
                                             value="<?php echo $distDB->getState() ?>"/>
                    </div>
                </div>

                <div class="space-4"></div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"><?php echo __("Zip / Postal Code")?></label>

                    <div class="col-sm-9">
                        <input name="zip" type="text" id="zip" tabindexBak="13" size="30"
                                             value="<?php echo $distDB->getPostcode() ?>"/>
                    </div>
                </div>

                <div class="space-4"></div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"><?php echo __("Email")?></label>

                    <div class="col-sm-9">
                        <input name="email" type="text" id="email" tabindexBak="13" size="30"
                                             value="<?php echo $distDB->getEmail() ?>"/>
                    </div>
                </div>

                <div class="space-4"></div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"><?php echo __("Contact Number")?></label>

                    <div class="col-sm-9">
                        <input name="contactNumber" type="text" id="contactNumber" tabindexBak="13" size="30"
                                             value="<?php echo $distDB->getContact() ?>"/>
                    </div>
                </div>

                <div class="space-4"></div>

                <div class="clearfix form-actions">
                    <div class="col-md-offset-3 col-md-9">
                        <button class="btn btn-info" type="button" id="btnSubmit">
                            <i class="icon-ok bigger-110"></i>
                            Submit
                        </button>
                    </div>
                </div>
            </form>
            <!-- PAGE CONTENT ENDS -->
        </div>
        <!-- /.col -->
    </div>

    <div class="page-header">
        <h1>
            <?php echo __("Bank Account Details")?>
        </h1>
    </div>

    <div class="row">
        <div class="col-xs-12">
            <form action="/member/updateBankInformation" id="bankForm" name="bankForm" method="post" class="form-horizontal" role="form">
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"><?php echo __("Bank Name")?></label>

                    <div class="col-sm-9">
                        <input name="bankName" type="text" id="bankName"
                             size="30" value="<?php echo $distDB->getBankName() ?>"/>
                    </div>
                </div>

                <div class="space-4"></div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"><?php echo __("Bank Account Number")?></label>

                    <div class="col-sm-9">
                        <input name="bankAccNo" type="text" id="bankAccNo" size="30"
                                                         value="<?php echo $distDB->getBankAccNo() ?>"/>
                    </div>
                </div>

                <div class="space-4"></div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"><?php echo __("Bank Account Holder Name")?></label>

                    <div class="col-sm-9">
                        <input name="bankHolderName" type="text" id="bankHolderName" size="30"
                                                         value="<?php echo $distDB->getBankHolderName() ?>"/>
                    </div>
                </div>

                <div class="space-4"></div>

                <div class="clearfix form-actions">
                    <div class="col-md-offset-3 col-md-9">
                        <button class="btn btn-info" type="button" id="btnBankUpdate">
                            <i class="icon-ok bigger-110"></i>
                            Submit
                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>